from applications.extensions import db


class FundStockListCwzx(db.Model):
    __tablename__ = 'fund_stock_list_cwzx'

    stock_id = db.Column(db.BigInteger, primary_key=True, autoincrement=True)
    create_time = db.Column(db.DateTime)
    update_time = db.Column(db.DateTime)
    create_date = db.Column(db.Date, comment='爬取日期')
    symbol = db.Column(db.String(64))
    name = db.Column(db.String(128))
    fund_code = db.Column(db.String(64), comment='基金code')
    fund_name = db.Column(db.String(64), comment='基金名称')
    stock_name = db.Column(db.String(64), comment='股票名称')
    stock_code = db.Column(db.String(64), comment='股票code')
    xq_symbol = db.Column(db.String(64), comment='股票code')
    xq_url = db.Column(db.String(64), comment='股票url')
    percent = db.Column(db.String(32), comment='持仓比例')
    cur_price = db.Column(db.Numeric(10, 2), comment='当前价格')
    original_price = db.Column(db.Numeric(10, 2), comment='原价')
    rises = db.Column(db.Numeric(10, 0), comment='区间涨幅')
    m_busi_income1 = db.Column(db.String(25), comment='主营业务收入增长率')
    n_profit_grate1 = db.Column(db.String(25), comment='净利润增长率(')
    n_assert_grate1 = db.Column(db.String(25), comment='净资产增长率')
    t_assert_grate1 = db.Column(db.String(25), comment='总资产增长率')
    m_busi_income2 = db.Column(db.String(25))
    n_profit_grate2 = db.Column(db.String(25))
    n_assert_grate2 = db.Column(db.String(25))
    t_assert_grate2 = db.Column(db.String(25))
    t_grade = db.Column(db.Numeric(10, 0), comment='今日总评')
    participation = db.Column(db.Numeric(10, 0), comment='机构参与度')
    manipulate = db.Column(db.String(25), comment='控盘程度')
    control_level = db.Column(db.String(25), comment='平均仓位')
    average_posi = db.Column(db.String(25), comment='资金动向')
    industry = db.Column(db.String(50), comment='行业')
    basic_eps = db.Column(db.String(25), comment='价值评估')
    value_assessment = db.Column(db.String(255), comment='爬取日期')
    organ_num = db.Column(db.Integer, comment='机构预测-机构数')
    avg_price = db.Column(db.Numeric(10, 2), comment='机构预测-平均价格')
    min_price = db.Column(db.Numeric(10, 2), comment='机构预测-最低价格')
    max_price = db.Column(db.Numeric(10, 2), comment='机构预测-最高价格')
    per_ttm = db.Column(db.Numeric(10, 2), comment='动态市盈率')
